$interested: #fb985d;

.discourse-post-event {
  display: flex;

  .discourse-post-event-widget {
    border: 5px solid var(--primary-low);
    display: flex;
    background: var(--secondary);
    margin: 5px 0;
    flex-direction: column;
    flex: 1 0 auto;
    max-width: 100%;
    box-sizing: border-box;

    .widget-dropdown {
      margin: 0;

      .widget-dropdown-header.disabled {
        pointer-events: none;
      }

      .widget-dropdown-item {
        &:not(.separator) {
          padding: 0.5em;
        }
        .d-icon + span {
          margin-left: 0.5em;
        }
      }
    }
  }

  &.is-loading {
    align-items: center;
    justify-content: center;
  }

  &.has-event {
    display: flex;
    flex-direction: column;
  }

  .event-header {
    display: flex;
    align-items: center;
    padding: 0 1em;
    height: 75px;

    .more-dropdown {
      margin-left: auto;
      align-self: flex-start;
      margin-top: 1em;

      &.has-no-actions {
        display: none;
      }

      .widget-dropdown {
        .widget-dropdown-header {
          .d-icon {
            margin: 0;
          }
          .label {
            display: none;
          }
        }

        .item-closeEvent {
          .d-icon,
          span {
            color: var(--danger);
          }
        }
      }
    }
  }

  .event-date {
    display: flex;
    flex-direction: column;
    width: auto;
    margin-right: 1em;

    .month {
      text-align: center;
      color: red;
      font-size: $font-down-1;
      text-transform: uppercase;
    }

    .day {
      text-align: center;
      font-weight: 500;
      font-size: $font-up-2;
    }
  }

  .event-info {
    display: flex;
    flex-direction: column;

    .name {
      font-weight: 700;
      @include ellipsis;
      max-width: 45vw;
    }
    .status-and-creators {
      display: flex;
      align-items: center;
      color: var(--primary-medium);
      font-size: $font-down-1;
      margin: 0.25em 0;

      .separator {
        margin: 0 0.25em;
      }

      .creators {
        display: flex;
        align-items: center;

        .event-creator {
          margin-left: 0.25em;

          .topic-invitee-avatar {
            display: flex;
            align-items: center;
          }
        }
      }

      .status {
        &.expired {
          color: var(--danger-medium);
        }

        .d-icon {
          margin-right: 0.5em;
        }
      }
    }
  }

  .event-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 1em;

    .event-status {
      margin: 0;

      &.status-going .going-button .d-icon {
        color: var(--success);
      }
      &.status-interested .interested-button .d-icon {
        color: $interested;
      }
      &.status-not_going .not-going-button .d-icon {
        color: var(--danger);
      }
    }
  }

  .event-creator {
    .username {
      margin-left: 0.25em;
    }
  }

  .event-invitees {
    display: flex;
    height: 110px;
    padding: 0 1em;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    flex-direction: column;

    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1em;
      width: 100%;

      .show-all {
        margin-left: 0.5em;
      }

      .event-invitees-status {
        font-weight: 700;

        .invited {
          font-weight: 500;
          color: var(--primary-medium);
        }
      }
    }

    .event-invitees-avatars {
      padding: 0;
      margin: 0;
      display: flex;
      flex-wrap: wrap;
      width: 100%;

      .event-invitee {
        list-style: none;
        margin-right: 0.5em;
        margin-bottom: 0.5em;
        opacity: 0.25;

        &.status-going,
        &.status-not_going,
        &.status-interested {
          opacity: 1;
        }

        &.status-going .avatar-flair {
          color: var(--success);
        }

        &.status-not_going .avatar-flair {
          color: var(--danger);
        }

        &.status-interested .avatar-flair {
          color: $interested;
        }
      }

      .topic-invitee-avatar {
        position: relative;
        display: inline-block;

        .avatar-flair {
          position: absolute;
          right: 0;
          bottom: 0;
          background: var(--secondary);
          border-radius: 50%;
          height: 16px;
          width: 16px;
          display: flex;
          align-items: center;
          justify-content: center;
          color: var(--primary-medium);
          border: 1px solid var(--primary-low);

          .d-icon {
            font-size: $font-down-3;
          }
        }
      }
    }
  }

  hr {
    margin: 0;
  }

  .event-url,
  .event-dates {
    display: flex;
    align-items: center;
    padding: 0 1em;
    height: 50px;
    flex: 1;

    .d-icon {
      color: var(--primary-high);
    }
  }

  .event-url {
    .url {
      margin-left: 1em;
      max-width: 80%;
      @include ellipsis;
    }
  }

  .event-dates {
    .participants {
      margin-left: 0.5em;
      color: var(--primary-medium);
    }

    .date {
      color: var(--primary-high);
      margin-left: 1em;

      .discourse-local-date {
        .d-icon {
          display: none;
        }
      }
    }

    .separator {
      color: var(--primary-high);
      margin: 0 0.5em;
      text-align: center;
    }
  }
}
